<template>
	<div id="setActivity">
		<div class="content-box">
			<!-- tab按钮 -->
			<ul class="prize-type-tab clearfix">
				<li class="active"><i></i>平台奖品</li>
			</ul>
			<div class="set-box">
				<div class="set-left" v-show="currentPrizeTabIndex=='0'">
					<div class="winning-container">
						<div class="pager"></div>
						<div class="win-content clearfix">
							<div class="win-img"><img :src="showForm1Img" /></div>
							<div class="win-text">
								<div class="win-text-title">{{form.name || '奖品名称'}}</div>
								<div class="win-text-time" v-show="form.validTimeType==0">有效期：{{form.expired_end | yearMonthDay}}</div>
							</div>
						</div>
						<div class="code-text text-center"  v-show="form.voucher_type==1">{{form.voucher_code}}</div>
						<div class="addonText text-center">{{form.addonText}}</div>
					</div>
					<div class="get-btn"></div>
				</div>
				
				<div class="set-right">
					<div class="set-content">
						<!-- 优惠券 -->
						<div class="tab-content" v-show="currentPrizeTabIndex=='0'">
							<div class="form-item-box clearfix">
								<div class="form-item-left require-item">奖品名称:</div>
								<div class="form-item-right">
									<input type="text" 
									       v-model="form.name"
										   maxlength="10"
									       placeholder="奖品名称不能重名,并且不能超过10个字">
								</div>
							</div>
							<div class="form-item-box clearfix">
								<div class="form-item-left require-item">有效时间:</div>
								<div class="form-item-right pick-date-box">
									<el-radio-group v-model="form.validTimeType">
								      <el-radio label="0">绝对时间</el-radio>
								      <!--<el-radio label="1">相对时间</el-radio>-->
								    </el-radio-group>
								</div>
							</div>
							<div class="form-item-box clearfix mtm">
								<div class="form-item-left"></div>
								<div class="form-item-right pick-date-box">
									<div v-show="form.validTimeType==0">
										<el-date-picker
									      v-model="form.expired_start"
									      value-format="timestamp"
									      format="yyyy-MM-dd HH:mm:ss"
										  :picker-options="pickerOptions"
									      type="datetime"
									      placeholder="选择开始时间">
									    </el-date-picker><span class="separate-box">至
									    </span><el-date-picker
									      v-model="form.expired_end"
									      type="datetime"
									      value-format="timestamp"
									      format="yyyy-MM-dd HH:mm:ss"
										  :picker-options="pickerOptions"
									      placeholder="选择结束时间">
									    </el-date-picker>
									</div>
									<div v-show="form.validTimeType==1">
										<span class="separate-box">中奖
								    </span><input class="input-lottery" type="text" min="1" v-model="form.invalidDays"><span class="separate-box">天后过期</span>
									</div>
								</div>
							</div>
							<div class="form-item-box clearfix">
								<div class="form-item-left require-item">券码类型:</div>
								<div class="form-item-right pick-date-box">
									<el-radio-group v-model="form.voucher_type">
								      <el-radio label="0">无券码</el-radio>
								      <el-radio label="1">统一码</el-radio>
								      <el-radio label="2">随机码</el-radio>
								    </el-radio-group>
								</div>
							</div>
							<div class="form-item-box clearfix mtm m0">
								<div class="form-item-left"></div>
								<div class="form-item-right pick-date-box c8">注意: 奖品保存后券码类型不能修改</div>
							</div>
							<div class="form-item-box clearfix" v-show="form.voucher_type==1">
								<div class="form-item-left">券码:</div>
								<div class="form-item-right">
									<input type="text" 
									       v-model="form.voucher_code"
									       placeholder="请输入券码,如果是条形码，请输入数字">
								</div>
							</div>

							<div class="form-item-box clearfix" v-show="form.voucher_type!=0">
								<div class="form-item-left require-item">显示方式:</div>
								<div class="form-item-right pick-date-box">
									<el-radio-group v-model="form.displayType">
								      <el-radio label="0">文本券码</el-radio>
								    </el-radio-group>
								</div>
							</div>
							<div class="form-item-box clearfix"  v-show="form.voucher_type==2">
								<div class="form-item-left require-item">上传券码:</div>
								<div class="form-item-right pick-date-box">
									<label id="file" class="file-label cursor">
										<input type="file" name="file" @change='addFileEvent' ref="couponFile" class="up-file-input"/> 
										<el-button v-text="form.fileName==''?'上传卷码':form.fileName"></el-button>
									</label>
									<div class="up-coupon">提示：CSV格式,每次最多导入10000条记录。下载 [<a class="cursor" href="./../../static/lib/file/券码示例.csv">示例</a>]</div>
								</div>
							</div>
							<div class="form-item-box clearfix" v-show="form.voucher_type!=2">
								<div class="form-item-left require-item" >库存:</div>
								<div class="form-item-right">
									<input type="text" v-model="form.stock_number" @blur="changeStockNo('form',form.stock_number)" min="1" placeholder="最大值为10000">
								</div>
							</div>
							<div class="form-item-box clearfix">
								<div class="form-item-left require-item">领奖链接:</div>
								<div class="form-item-right">
									<input type="text" v-model="form.exchange_url" placeholder="例如: http://www.baidu.com">
								</div>
							</div>
							<div class="form-item-box clearfix mtp">
								<div class="form-item-left require-item">奖品图片:</div>
								<div class="form-item-right add-banner">
									<span class="add-banner-btn" 
										  v-show="!form.prizeImg"
										  @click="showUploadPicToast">+</span>
									<img v-show="form.prizeImg" :src="form.prizeImg" />
									<i class="fa fa-times" 
									   aria-hidden="true"
									   v-show="form.prizeImg"
									   @click="cancelBanner"></i>
									<p>300*300像素，支持PNG、JPG格式，小于50KB</p>
								</div>
							</div>
						</div>
						

						



						
						
							
						<div id="save-btn" 
						     class="mtp"
						     @click="createNewPrize">保存</div>
					</div>
				</div>
			</div>
		</div>

		<!-- 上传图片弹框 -->
		<div class="add-prize-mask" v-if="uploadPicBox" >
			<div id="upload-pic-box" v-loading="imgUpLoading"
				:element-loading-text="imgUpLoadingText">
				<div class="add-prize-header">
					上传图片
					<span class="upload-close" @click="hideUploadPicToast"></span>
				</div>
				<div class="upload-body">
					<ul class="clearfix upload-img-list">
						<li><input type="file" 
								   name="upfile"
							       @change='addImgEvent'
							       accept="image/png, image/jpeg, image/jpg">
						</li>
						<li v-for="(item, index) in uploadPicList"
							@click="chooseprizeImg(index)"
							:class="{'border-red': currentBannerIndex===index}"
						    :style="{'background-image': 'url('+item.src+')'}"></li>
					</ul>
				</div>
				<div class="add-prize-footer">
					<div class="page-inner upload-page-inner">
						<div style="display:inline-block;">
							<el-pagination
								small
								layout="prev, pager, next"
								:total="updateImgtotal"
								@current-change="pageChange"
								>
							</el-pagination>
						</div>
						<el-button @click="hideUploadPicToast">取消</el-button>
						<el-button type="primary" @click="comfirmprizeImg">确定</el-button>
					</div>
				</div>
			</div>
		</div>
	</div>
</template>
<script>
	import * as api from './../api/api'
	import Vue from 'vue'
	export default {
		data(){
			return {
				pickerOptions: {
					disabledDate(time) {
						return time.getTime() < Date.now() - 8.64e7;
					}
				},
				imgUpLoading:false,  //图片上传加载
				imgUpLoadingText:'上传中',
				currentPrizeTabIndex: 0,
				defaultPrizeImg: require('../assets/img/promotion_default.png'),
				//优惠券配置
				form: {
					type_code: 'coupon',
					resource: '1',
					name: '',
					expired_start: '',
					expired_end: '',
					exchange_method: '0',
					exchange_url: '',
					background_image: '',
					sku: '',
					validTimeType: '0',
					invalidDays: '',
					voucher_type: '0',  //券码类型
					voucher_code:'',  //券码
					voucher_link:'', //上传文件路径
					fileName:'',  //文件名称
					addonText: '',					
					displayType:'0', //显示方式					
					stock_number: '',
					getPrizeUrl: '',
					optionValue: '0',
					tagValue: '',
					tagDetailValue: '',
					prizeImg: '',
				},
				//微信红包
				wxForm:{
					name:''
				},
				sponsor:[{
					name: '',
					logo: '',
					percent: ''
				}],
				options: [{
		          value: '0',
		          label: '次/活动全程'
		        },{
		          value: '1',
		          label: '次/每日'
		        }],
				tagOptions: [{
		          value: '2',
		          label: '吃货一族'
		        },{
		          value: '3',
		          label: '旅行达人'
		        },{
		          value: '4',
		          label: '职场新人'
		        },{
		          value: '5',
		          label: 'IT达人'
		        },{
		          value: '6',
		          label: '数码一族'
		        }],
		        prizeOptions: [],
		        content: '',
			    editorOption: {
			        
		        },
		        tabData: ['内容设置','奖品设置','拉新设置','信息备注'],
		        currentTab: 0,
		        specialRuleData: [],
		        addPrizeBox: false,
		        pickedPrizeList: [],
		        
		        uploadPicList:[],
		        currentBannerIndex: -1,
		        uploadPicBox: false,
		        sponsorBealoon: false,
				sponsorIndex:null, //当前点击的logo
				//上传图片分页
				updateImgcurrent_page:1, //当前页码
                updateImglast_page:'',//最后一页
                updateImglimit:10, //一页显示多少条
                updateImgtotal:1, //总条数
			}
		},
		watch:{
			'form.voucher_type'(a,b){
				if(a!=0){
					this.form.addonText='长按复制券码去兑换';
				}else{
					this.form.addonText='';
				}
			}
		},
		mounted(){
            

		},
		components: {

		},
        computed: {
          	editor() {
	        	return this.$refs.myQuillEditor.quill;
	      	},
	      	showForm1Img(){
	      		var img = this.form.prizeImg?this.form.prizeImg:this.defaultPrizeImg;
	      		return img;
	      	},
	      	showEntityImg(){
	      		return this.form1.prizeImg?this.form1.prizeImg:this.defaultPrizeImg;
	      	}
        },
        methods: {
			//切换tabs
        	choosePrizeTypeTab(index){
				let vm = this;
        		if (this.currentPrizeTabIndex == index) {
        			return;
        		}
				
        		this.currentPrizeTabIndex = index;
        		if (index == '0') {
        			this.form.addonText = '';
        		} else if (index == '1') {
        			this.form1.addonText = '奖品发货时，您填写的手机号会收到短信通知';
        		}
        	},

        	createNewPrize(){
        		var that = this;
        		var type = that.currentPrizeTabIndex;
		        
		        //赞助商信息
		        var _obj = {};
		        _obj.name = [];
		        _obj.logo = [];
		        _obj.percent = [];
				that.sponsor.forEach((item,index)=>{
					_obj.name.push(item.name);
					_obj.logo.push(item.logo);
					_obj.percent.push(item.percent);
				})
		        //优惠券
        		if (type == '0') {
        			that.form.expired_start = that.formatDate(that.form.expired_start);
        			that.form.expired_end = that.formatDate(that.form.expired_end);
					if(that.form.voucher_type==2){
						that.form.stock_number=0;
					}
        			var params = {
        				prize: that.form,
        				sponsor: _obj
        			};
        			var body = {
        				data: params
        			};
					if(that.CouponReg()&&that.sponsorReg()){
						that.postApiAll(body);
					}
        		} else { //实物
        			that.form1.expired_start = that.formatDate(that.form1.expired_start);
        			that.form1.expired_end = that.formatDate(that.form1.expired_end);
        			var params = {
        				prize: that.form1,
        				sponsor: _obj
        			};
        			var body = {
        				data: params
        			};
					if(that.entityReg()&&that.sponsorReg()){
						that.postApiAll(body);
					}
        		};

    			
        	},
			//提交保存
			postApiAll(obj){
				let that= this;
				let loading = that.$loading({
		          lock: true,
		          text: 'Loading',
		          spinner: 'el-icon-loading',
		          background: 'rgba(0, 0, 0, 0.7)'
		        });
				api.createNewPrize(obj).then(res => {
	          		loading.close();
    				if (res.data.code == '0' || res.data.code == '200') {
    					that.$router.replace({name:'prizeList'});
    				} else {
						that.$message({
				          showClose: true,
				          type: 'error',
				          message: res.data.result,
				        });
    				}
    			}).catch(err => {
                    that.httpStatusCode(err);
    				that.print(err);
    			});
			},
			//奖品赞助商信息
			sponsorReg(){
				let vm = this;
				let flag;
				if(vm.sponsor.length!=0){
					vm.sponsor.forEach((item,index)=>{
						if(item.name==''){
							vm.$message({showClose: true,message: '赞助商信息不能为空'});
							return flag=false;
						}else if(item.logo==''){
							vm.$message({showClose: true,message: '商家LOGO不能为空'});
							return flag=false;
						}else if(item.percent>100||item.percent<=0){
							vm.$message({showClose: true,message: '曝光率范围为0%~100%'});
							return flag=false;
						}else{
							flag=true;
						}
					});
				}else{					
					vm.$message({showClose: true,message:'赞助商信息不能为空'});
					flag=false;
				}
				return flag;
			},
			//优惠卷验证
			CouponReg(){
				let reg=/^(https|http|ftp|rtsp|mms):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&:/~\+#]*[\w\-\@?^=%&/~\+#])?$/;
				let num = /^\+?[1-9][0-9]*$/;　
				if(this.form.name==''){
					this.$message({showClose: true,message: '奖品名称不能为空'});	
					return false;
				}else if((this.form.expired_start==''||this.form.expired_end=='')&&this.form.validTimeType==0){
					this.$message({showClose: true,message: '请选择活动时间'});
					return false;
				}else if((this.form.invalidDays==''||this.form.invalidDays<1)&&this.form.validTimeType==1){
					this.$message({showClose: true,message: '相对时间不能小于1'});
					return false;
				}else if((this.form.stock_number==''||this.form.stock_number<1||this.form.stock_number>10000||!num.test(this.form.stock_number))&&this.form.voucher_type!='2'){
					this.$message({showClose: true,message: '库存为1~10000的整数,且不能为空'});
					return false;
				}else if(this.form.voucher_link==''&&this.form.voucher_type==2){
					this.$message({showClose: true,message: '请上传券码'});
					return false;
				}else if(this.form.exchange_url==''||!reg.test(this.form.exchange_url)){
					this.$message({showClose: true,message: '请输入正确的领奖链接'});
					return false;
				}else if(this.form.prizeImg==''){
					this.$message({showClose: true,message: '详情图片不能为空'});
					return false;
				}else{
					return true;
				}				
			},
			//实物验证
			entityReg(){
				let num = /^\+?[1-9][0-9]*$/;　
				if(this.form1.name==''){
					this.$message({showClose: true,message: '奖品名称不能为空'});	
					return false;
				}else if((this.form1.expired_start==''||this.form1.expired_end=='')&&this.form1.validTimeType==0){
					this.$message({showClose: true,message: '请选择活动时间'});
					return false;
				}else if((this.form.invalidDays==''||this.form.invalidDays<1)&&this.form1.validTimeType==1){
					this.$message({showClose: true,message: '相对时间不能小于1'});
					return false;
				}else if(this.form1.stock_number==''||this.form1.stock_number<1||this.form1.stock_number>10000||!num.test(this.form1.stock_number)){
					this.$message({showClose: true,message: '库存为1~10000的整数,且不能为空'});
					return false;
				}else  if(this.form1.prizeImg==''){
					this.$message({showClose: true,message: '详情图片不能为空'});
					return false;
				}else{
					return true;
				}	
			},
			//库存验证
			changeStockNo(item,val){
				let num = /^\+?[1-9][0-9]*$/;　
				if(item=='form'){
					if(!num.test(val)||val<1||val>10000){
						this.$message({showClose: true,message: '库存为1~10000的整数,且不能为空'});
					}
				}else if(item=='form1'){
					if(!num.test(val)||val<1||val>10000){
						this.$message({showClose: true,message: '库存为1~10000的整数,且不能为空'});
					}	
				}
			},
        	//格式化时间
        	formatDate(time){
				if(time){
					var date = new Date(time);
					var year = date.getFullYear(),
						month = date.getMonth() + 1,
						day = date.getDate(),
						hour = date.getHours(),
						min = date.getMinutes(),
						sec = date.getSeconds();
					var newTime = year + '-' +
								month + '-' +
								day + ' ' +
								hour + ':' +
								min + ':' +
								sec;
					return newTime; 		
				}else{
					return ''
				}
			            
			},


		    onEditorReady(editor) {
		        console.log('editor ready!', editor)
		    },
		    tabClickEvent(index){
				this.currentTab = index;
			},
			addSpecialRule(){
				var prizeLength = this.pickedPrizeList.length;
				if (prizeLength === 0) {
					this.$message({
			          showClose: true,
			          message: '请先添加奖品,然后再设置特殊规则'
			        });
				} else {
					var obj = {
						expired_start: '',
						expired_end: '',
						prizeOptionValue: 0,
						prizeNum: '0'
					}
					this.specialRuleData.push(obj);
				}
			},
			deleteSpecialRule(index){
				Vue.delete(this.specialRuleData, index);
			},
			showAddPrizeToast(){
				this.addPrizeBox = true;
			},
			hideAddPrizeToast(){
				this.addPrizeBox = false;
			},
			pickPrize(item){
				this.addPrizeBox = false;
				this.pickedPrizeList.push(item);
				var index = this.prizeOptions.length;
				var obj = {
					value: index,
					label: item.name
				};
				this.prizeOptions.push(obj);
			},
			deletePickedPrize(index){
				Vue.delete(this.pickedPrizeList, index);
			},

			//添加详情图片
			showUploadPicToast(){
				this.uploadPicBox = true;
				this.sponsorBealoon = false;
			},
			//添加商家logo
			showUploadPicToastSponsor(index){
				this.uploadPicBox = true;
				this.sponsorBealoon = true;
				this.sponsorIndex=index;
			},
			hideUploadPicToast(){
				this.uploadPicBox = false;
				this.imgUpLoading=false;
				this.currentBannerIndex = -1;
			},
			chooseprizeImg(index){
				this.currentBannerIndex = index;
			},
			comfirmprizeImg(){
				var curIndex = this.currentBannerIndex;
				if (curIndex === -1) {
					this.$message({
			          showClose: true,
			          message: '请先选择banner图'
			        });
				} else if (this.currentPrizeTabIndex === 0) {
					this.form.prizeImg = this.uploadPicList[curIndex].src;
					this.hideUploadPicToast();
				} else {
					this.form1.prizeImg = this.uploadPicList[curIndex].src;
					this.hideUploadPicToast();
				}
			},
			cancelBanner(){
				if (this.currentPrizeTabIndex === 0) {
					this.form.prizeImg = '';
				} else {
					this.form1.prizeImg = '';
				}
			},
			cancelSponsorLogo(index){
				this.sponsor[index].logo= '';
			},
			print(text){
				console.log("%c"+text, " text-shadow: 0 1px 0 #ccc,0 2px 0 #c9c9c9,0 3px 0 #bbb,0 4px 0 #b9b9b9,0 5px 0 #aaa,0 6px 1px rgba(0,0,0,.1),0 0 5px rgba(0,0,0,.1),0 1px 3px rgba(0,0,0,.3),0 3px 5px rgba(0,0,0,.2),0 5px 10px rgba(0,0,0,.25),0 10px 10px rgba(0,0,0,.2),0 20px 20px rgba(0,0,0,.15);font-size:2em");
			},
			addImgEvent(event){
				var that = this;
				that.imgUpLoading=true;
				that.imgUpLoadingText='上传中';
	            var img1 = event.target.files[0];
	            //生成临时图片路径
                var temSrc = URL.createObjectURL(img1);
                //判断图片尺寸大小
	            var size = img1.size/1024;
	            //小于150k
	            if(size>150){
					that.imgUpLoading=false;
            		that.$message({
                      showClose: true,
                      type: 'error',
                      message: '图片大小不能大于150KB'
                    }); 
	                return false;  
	            };
	            //判断图片像素尺寸
        		var _img = new Image();
        		_img.onload = function  () {
        			var imgWidth = _img.width,
        				imgHeight = _img.height;
        			// if (imgWidth!=300 || imgHeight!=300) {
	            	// 	that.$message({
	                //       showClose: true,
	                //       type: 'error',
	                //       message: '请上传尺寸为300*300的图片'
	                //     });
		            //     return false;
        			// };
        			if (that.currentPrizeTabIndex === 0 && !that.sponsorBealoon) {
				        that.form.prizeImg = temSrc;
				        //上传图片
				        var formdata = new FormData();
				        formdata.append('upfile', img1);
				        api.uploadPrizeImg(formdata).then(res => {
							that.hideUploadPicToast();
							
							that.$message({
								message: '上传成功',
								type: 'success'
							});
				        	that.form.background_image = res.data.result;
				        }).catch(err => {
							that.imgUpLoading=false;
				        	that.print(err);
                    		that.httpStatusCode(err);
				        })
        			} else if (that.currentPrizeTabIndex === 1 && !that.sponsorBealoon) {
				        that.form1.prizeImg = temSrc;
				        //上传图片
				        var formdata = new FormData();
				        formdata.append('upfile', img1);
				        api.uploadPrizeImg(formdata).then(res => {
							that.hideUploadPicToast();
							that.$message({
								message: '上传成功',
								type: 'success'
							});
				        	that.form1.background_image = res.data.result;
				        }).catch(err => {
							that.imgUpLoading=false;
				        	that.print(err);
                    		that.httpStatusCode(err);
				        })
        			}else if (that.sponsorBealoon) {
				        //上传图片
				        var formdata = new FormData();
				        formdata.append('upfile', img1);
				        api.uploadPrizeImg(formdata).then(res => {
							that.hideUploadPicToast();
							that.$message({
								message: '上传成功',
								type: 'success'
							});
				        	that.sponsor[that.sponsorIndex].logo = res.data.result;
				        }).catch(err => {
							that.imgUpLoading=false;
				        	that.print(err);
                    		that.httpStatusCode(err);
				        })
        			};
					setTimeout(function  () {
			        	URL.revokeObjectURL(temSrc);
			        },100);
        		}
        		_img.src = temSrc;
			},
			//上传图片分页 点击当前的页数
            pageChange(a){
                this.updateImgcurrent_page=a;
            },
			//添加赞助商
			addSponsor(){
				if(this.sponsor.length<5){
					this.sponsor.push({ name: '', logo: '', percent: '' });
				}else{
					this.$message({  message: '只能添加5个赞助商'});
				}
			},
			//删除赞助商
			clearSponsor(index){
				if(this.sponsor.length>1){
					Vue.delete(this.sponsor, index);
				}else{
					this.$message({  message: '至少添加一个赞助商'});
				}
				
			},
			addFileEvent(e){
				let vm = this;
				let ext=e.target.value.toLowerCase().split('.').splice(-1);
				
				if ("csv" != ext) {  
					vm.$message({  message: '只能上传csv文件'});
					return false;  
				}else{
					vm.form.fileName=e.target.files[0].name;
					let form = new FormData();  
        			form.append('upfile', e.target.files[0]);
					api.uploadPrizeImg(form).then(res=>{
						if(res.data.code==0){
							vm.form.voucher_link=res.data.result;	
							vm.$message({ message: '上传成功', type: 'success' });
						}
					});	
				}  	
			},
        }
	}
</script>
<style>
	/* 修改输入框样式 */
	.pick-date-box .el-input__inner{
		height: 34px;
		box-sizing: border-box;
		border-radius: 0;
		background-color: #f4f8fb;
	    color: #888;
	    border: 1px solid #efefef;
	    box-shadow: none;
	    font-size: 12px;
	    width: 100%;
        height: 34px;
        padding: 6px 12px;
        box-sizing: border-box;
	}
	.special-item .el-input__inner{
		height: 32px;
		box-sizing: border-box;
		border-radius: 0;
		background-color: #f4f8fb;
	    color: #888;
	    border: 1px solid #efefef;
	    box-shadow: none;
	    font-size: 12px;
	    width: 109px;
        padding: 6px 12px;
        box-sizing: border-box;
	}
	.special-item .el-date-editor i{
		display: none;
	}
	.special-item .el-select .el-input__inner{
		padding-right: 25px;
		width:130px;
	}
	.lotteryNum-box .el-input__inner{
		width:142px;
		box-sizing: border-box;
		border-radius: 0;
		height: 34px;
		font-size: 12px;
	    color: rgb(136, 136, 136);
	    border-color: rgb(239, 239, 239);
	    background-color: rgb(238, 238, 238);
	}
	.tag-box .el-input__inner{
		width:160px;
	}
	.tag-box .el-input{
	}
	.rule-box .ql-container{
		height: 300px;
		background: #f4f8fb;
	}
	.share-switch .el-switch{
		position: relative;
		top:-1px;
	}
	.rule-title .el-switch{
		top:-1px;
		left: 10px;
	}
	.el-switch__label span{
		color:rgba(0,0,0,0);
	}
	#add-prize-box .el-input {
	    width: 260px;
	}
	input{
		vertical-align: baseline;
	}
	.pick-date-box .el-radio__label{
		font-size: 12px;
	}
	.pick-date-box .el-radio__inner{
		width:14px;
		height: 14px;
		position: relative;
	}
	.pick-date-box .el-radio-group{
		line-height: 34px;
	}
</style>
<style lang="less" scoped>
	@import '../style/setTemplate';
	@import '../style/prizeCreate';
	.win-img img{
		width:100%;
		height: 100%;
	}
</style>